package cqrtplm.listener;


import cn.hutool.extra.spring.SpringUtil;
import com.hustcad.plm.pdm.workflow.annotion.CustomListener;
import cqrtplm.service.RtZdService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;

@Slf4j
@CustomListener(category = "润通", description = "保存申请单信息")
public class SaveApplicationFormListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution delegateExecution) {

        String workFlowContainerId = delegateExecution.getProcessInstanceBusinessKey();
        RtZdService rtZdService = SpringUtil.getBean(RtZdService.class);
        try {
            rtZdService.saveApplicationFormData(workFlowContainerId);
        }catch (Exception e) {
            log.info("保存申请单");
        }

    }
}
